Systems, devices and methods for tracking objects on a display

ABSTRACT

Systems, devices and methods for improved tracking with an electronic device are disclosed. The disclosures employ advanced exposure compensation and/or stabilization techniques. The tracking features may therefore be used in an electronic device to improve tracking performance under dramatically changing lighting conditions and/or when exposed to destabilizing influences, such as jitter. Historical data related to the lighting conditions and/or to the movement of a region of interest containing the tracked object are advantageously employed to improve the tracking system under such conditions.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional PatentApplication No. 61/870,736, filed Aug. 27, 2013, entitled EXPOSURECOMPENSATION FOR TRACKING SYSTEM, and claims the benefit of U.S.Provisional Patent Application No. 61/870,724, filed Aug. 27, 2013,entitled STABILIZATION SYSTEM FOR CAMERA TRACKING SYSTEM, the disclosureof each of which is incorporated herein by reference in its entirety.

BACKGROUND

1. Field of the Invention

This disclosure relates generally to systems and methods of trackingobjects captured by a digital image sensor. In particular, systems andmethods of tracking objects with video recording devices are disclosed.

2. Description of the Related Art

With the advent of inexpensive and smaller recording systems, therecording industry is growing. More and more people enjoy recordingobjects in their environment using digital recording systems such asvideo cameras and mobile devices. The recordings can be used in avariety of applications, for instance for professional uses, for fun andpleasure, or for recording sentimental memories. Given the vast numberof uses of recordings, more features and capabilities of these recordingdevices are desirable.

One of the features that digital recording systems may therefore haveare tracking systems that can track on object in its field of view. Forinstance, U.S. Pat. Nos. 8,483,437; 8,310,665; 8,249,299; and 8,224,029,the contents of each of which are incorporated herein in their entirety,disclose recording systems for tracking objects. However, for some usesof recording systems, the ability for stable tracking of objects beingcaptured under dramatically changing lighting conditions is needed. Forexample, a user may track a soccer player as the player is running downthe field from bright to shaded areas. Conventional tracking systemsoperating under such conditions may not perform optimally as theirtracking systems struggle to remain locked on a target moving frombright to darker areas. For instance, conventional auto exposure systemsare typically used to adjust to these changes in lighting. However,these systems may not respond to dramatic changes in light quick enoughto maintain a lock on a target object in a scene and therefore may notbe optimal for use in recording systems with tracking capabilities.

Further, some conventional tracking systems may have difficultydistinguishing between true movement of an item being tracked versusapparent movement that is actually due to noise in the system, such asfrom shaking of the recording device.

SUMMARY

Embodiments of a method of tracking an object captured in a scene ofinterest with an electronic device are disclosed. In some embodiments,the method comprises determining an average light intensity of pixels ina region of a first image frame comprising the object; determining anaverage light intensity of pixels in the region of a second image framecomprising the object; comparing the determined average lightintensities for the region in the first and second image frames;adjusting the intensity of pixels in the second image frame when achange in the average light intensity of pixels in the region is greaterthan an intensity limit; and tracking the object using the pixels in thesecond image frame.

In some embodiments, the adjusting comprises defining a reference valueas the average light intensity of pixels in the region of the firstimage frame comprising the object.

In some embodiments, the change in the average light intensity of pixelsin the region comprises the difference between the reference value andthe average light intensity of pixels in the region of the second imageframe.

In some embodiments, the adjusting comprises subtracting the differencefrom every pixel of the second image frame.

In some embodiments, the method further comprises periodicallyredefining the reference value, as the average light intensity of pixelsin the region of the second image frame, if the difference is less thanan intensity limit.

In some embodiments, the tracking the object comprises calculating avariation indicator of the region based on current and historicalparameters of the region.

In some embodiments, the tracking the object further comprisescalculating a confidence level based on comparison of the variationindicator with the historical parameters.

In some embodiments, the method further comprises passing the secondimage frame to the tracking system when the confidence level is greaterthan a specified confidence threshold.

In some embodiments, the current and historical parameters comprise,respectively, current and historical sizes of the region.

In some embodiments, the current and historical parameters comprise,respectively, current and historical locations of the region.

Several embodiments of a system for tracking an object with anelectronic device are disclosed. In some embodiments, the systemcomprises a processor configured to determine an average light intensityof pixels in a region of a first image frame comprising the object;determine an average light intensity of pixels in the region of a secondimage frame comprising the object; compare the determined average lightintensities for the region in the first and second image frames; adjustthe intensity of pixels in the second image frame when a change in theaverage light intensity of pixels in the region is greater than anintensity limit; and track the object using the pixels in the secondimage frame.

In some embodiments, the adjusting comprises defining a reference valueas the average light intensity of pixels in the region of the firstimage frame comprising the object, wherein the change in the averagelight intensity of pixels in the region comprises the difference betweenthe reference value and the average light intensity of pixels in theregion of the second image frame.

In some embodiments, the adjusting further comprises subtracting thedifference from every pixel of the second image frame.

In some embodiments, the processor is further configured to periodicallyredefine the reference value, as the average light intensity of pixelsin the region of the second image frame, if the difference is less thanan intensity limit.

In some embodiments, the tracking the object comprises calculating avariation indicator of the region based on current size and location ofthe region and historical size and location of the region.

In some embodiments, the tracking the object further comprisescalculating a confidence level based on comparison of the variationindicator with the historical size and location of the region.

In some embodiments, the system further comprises passing the secondimage frame to the tracking system when the confidence level is greaterthan a specified confidence threshold.

In some embodiments, a system for tracking an object with an electronicdevice comprises means for determining an average light intensity ofpixels in a region of a first image frame comprising the object; meansfor determining an average light intensity of pixels in the region of asecond image frame comprising the object; means for comparing thedetermined average light intensities for the region in the first andsecond image frames; means for adjusting the intensity of pixels in thesecond image frame when a change in the average light intensity ofpixels in the region is greater than an intensity limit; and means fortracking the object using the pixels in the second image frame.

In some embodiments, the means for adjusting comprises defining areference value as the average light intensity of pixels in the regionof the first image frame comprising the object, wherein the change inthe average light intensity of pixels in the region comprises thedifference between the reference value and the average light intensityof pixels in the region of the second image frame.

In some embodiments, the means for adjusting further comprises means forsubtracting the difference from every pixel of the second image frame.

In some embodiments, the system further comprises means for periodicallyredefining the reference value, as the average light intensity of pixelsin the region of the second image frame, if the difference is less thanan intensity limit.

In some embodiments, the means for tracking the object comprises meansfor calculating a variation indicator of the region based on currentsize and location of the region and historical size and location of theregion.

In some embodiments, the means for tracking the object further comprisesmeans for calculating a confidence level based on comparison of thevariation indicator with the historical size and location of the region;and means for passing the second image frame to the tracking system whenthe confidence level is greater than a specified confidence threshold.

Several embodiments of a non-transitory computer readable mediumconfigured to store instructions that when executed by a processorperform a method for tracking an object with an electronic device aredisclosed. In some embodiments, the method comprises determining anaverage light intensity of pixels in a region of a first image framecomprising the object; determining an average light intensity of pixelsin the region of a second image frame comprising the object; comparingthe determined average light intensities for the region in the first andsecond image frames; adjusting the intensity of pixels in the secondimage frame when a change in the average light intensity of pixels inthe region is greater than an intensity limit; and tracking the objectusing the pixels in the second image frame.

In some embodiments, the method of the computer readable medium furthercomprising defining a reference value equal as the average lightintensity of pixels in the region of the first image frame comprisingthe object, wherein the change in the average light intensity of pixelsin the region comprises the difference between the reference value andthe average light intensity of pixels in the region of the second imageframe.

In some embodiments, the method of the computer readable medium furthercomprises subtracting the difference from every pixel of the secondimage frame.

In some embodiments, the method of the computer readable medium furthercomprises periodically redefining the reference value, as the averagelight intensity of pixels in the region of the second image frame, ifthe difference is less than an intensity limit.

In some embodiments, the method of the computer readable medium furthercomprises calculating a variation indicator of the region based oncurrent size and location of the region and historical size and locationof the region.

In some embodiments, the method of the computer readable medium furthercomprises calculating a confidence level based on comparison of thevariation indicator with the historical size and location of the region;and passing the second image frame to the tracking system when theconfidence level is greater than a specified confidence threshold.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other features of the present disclosure will becomemore fully apparent from the following description and appended claims,taken in conjunction with the accompanying drawings. Understanding thatthese drawings depict only several embodiments in accordance with thedisclosure and are not to be considered limiting of its scope, thedisclosure will be described with additional specificity and detailthrough use of the accompanying drawings. In the following detaileddescription, reference is made to the accompanying drawings, which forma part hereof. In the drawings, similar symbols typically identifysimilar components, unless context dictates otherwise. The illustrativeembodiments described in the detailed description, drawings, and claimsare not meant to be limiting. Other embodiments may be utilized, andother changes may be made, without departing from the spirit or scope ofthe subject matter presented here. It will be readily understood thatthe aspects of the present disclosure, as generally described herein,and illustrated in the Figures, can be arranged, substituted, combined,and designed in a wide variety of different configurations, all of whichare explicitly contemplated and make part of this disclosure.

FIG. 1 depicts an embodiment of a conventional auto exposure process andthe resulting image frames produced thereby.

FIG. 2 depicts an embodiment of a compensated exposure process and theresulting image frames produced thereby.

FIGS. 3A-3B depict embodiments of image frames produced by a recordingdevice with a tracking system having exposure compensation andstabilization.

FIGS. 4A-4B are charts showing embodiments of changing lightingintensity levels and corresponding compensated intensity levels andchanges in reference values.

FIG. 5 depicts a block diagram of a recording device comprising atracking system having modules for managing exposure compensation andstabilization.

FIG. 6 is a flow chart diagramming one embodiment of a method forinitializing a reference value and parameters of a region of interest.

FIG. 7 is a flow chart diagramming one embodiment of an overview of amethod for exposure compensation and stabilization.

FIG. 8 is a flow chart showing one embodiment of a method for exposurecompensation and stabilization using a reference value and variationindicators.

FIG. 9 is a coordinate diagram showing one embodiment of the results ofa computational tool for determining a variation indicator andconfidence level.

FIGS. 10A-H are line graphs showing one embodiment of the results ofusing a computational tool for determining a gain value.

DETAILED DESCRIPTION

The following detailed description is directed to certain specificembodiments of the development as described with reference to FIGS. 1-7.In this description, reference is made to the drawings wherein likeparts or steps may be designated with like numerals throughout forclarity. Reference in this specification to “one embodiment,” “anembodiment,” or “in some embodiments” means that a particular feature,structure, or characteristic described in connection with the embodimentis included in at least one embodiment of the invention. The appearancesof the phrases “one embodiment,” “an embodiment,” or “in someembodiments” in various places in the specification are not necessarilyall referring to the same embodiment, nor are separate or alternativeembodiments mutually exclusive of other embodiments. Moreover, variousfeatures are described which may be exhibited by some embodiments andnot by others. Similarly, various requirements are described which maybe requirements for some embodiments but not other embodiments.

Systems, devices and methods for tracking objects in a scene of interestcaptured by a digital imaging device are described. For example, one maywish to track one particular player in a sporting event as the game isbeing played. That allows the system to record the movements of thatparticular player more closely than other players on a field or court.In one embodiment, the tracking features of the system are enhanced byusing exposure compensation and stabilization techniques to maintain atracking lock on the object of interest. For example, one embodimentuses exposure compensation and stabilization techniques that are basedon comparing historical image data with more current image data toretain a tracking lock on the designated object. The capability of thedigital camera to track the object of interest is thus enhanced. Theexposure compensation can mitigate the deleterious effect of changinglighting conditions on the tracking system, which can contribute totracking systems losing an object being tracked.

In one embodiment, the digital imaging device includes an imagestabilization module configured to mitigate the effect of jitter,shaking, lag and other unfavorable factors on its tracking system. Thisallows the device to identify actual object movement more accuratelywhile using confidence levels applied to a weighted filter. Thesesystems and associated methods were found to produce a smoother, morereliable tracking system for the digital imaging device.

In operation, embodiments of a digital imaging system have an imagecapture system that includes an image sensor and a lens to form adigital camera. In one embodiment, the field of view of the camera issampled for the average intensity of light in a region of interest overtime. In addition, the system can determine the size, position andorientation of an object being tracked. The average intensity of lightdata that is captured can then be used to compensate for exposurechanges in the tracked object of interest, while the movementinformation captured by the imaging sensor over time can be used tostabilize the image to allow more accurate tracking of the object ofinterest.

In one embodiment, the digital imaging system is configured to determinewhether captured frames should first be conditioned in some mannerbefore being sent to an integrated tracking system. In making thisdetermination, light data from a current image frame is compared tohistorical light data from earlier image frames. The light data may bean average pixel value over a region of interest in the field of view ofthe captured image frame. If a dramatic change in lighting conditionsbeyond a specified threshold is detected, then the historical light datacan be defined as a “reference value” to be used while the lightingcondition is changing. During the period of dramatic lighting change,each newly captured image frame is compensated based on the referencevalue of the earlier image frame. In one embodiment, the captured frameis compensated using the reference value by taking the differencebetween the reference value and the lighting condition of that frame,and subtracting that difference from the entire image. This updatedimage is then transmitted to the tracking system for processing. Thiscompensation continues as long as dramatic changes in lightingconditions continue over time. When the lighting conditions are notdramatically changed, an unchanged or slightly changed image frame maybe passed onto the tracking system, and the reference value periodicallyupdates during this time in preparation for the next dramatic lightingcondition.

In another embodiment, historical movement data for objects in a regionof interest are compared to more current movement data to determinewhether the object being tracked has actually moved or whether there iscamera shaking or jitter. By comparing the two sets of movement data, amagnitude and direction of the object's movement is calculated. Todetermine whether a calculated magnitude and direction is actualmovement or just jitter, a confidence level is applied whereby onlythose movements above a certain confidence threshold cause the system totrack in that direction. Further, a filter weighting or gain is alsoapplied which, in conjunction with the historical movement data,enhances the ability to discern true movement of an object and reducesthe lagging effect of typical tracking algorithms.

The system in some embodiments will first apply the exposurecompensation and then the stabilization. Therefore, the light data willfirst be assessed so as to transmit a properly lighted image frame tothe tracking system. Then, the movement data will be analyzed in theproperly lighted image frame to discern whether the movement is jitteror is actual movement of the tracked object.

Turning now to FIG. 1, a conventional auto exposure process 50 and theresulting image frames produced thereby are shown. The process may beginwith normal light condition 100. Under this lighting condition, theimage input to the device for use with a tracking system may appear asit does in image 110. Next, a light condition change 120 may occurwhereby the lighting is brighter. As a result, the item being recordedis subject to a bright light condition 101. This results in the imagebeing overexposed with degraded image quality as shown in saturatedimage 111.

The bright light condition 101 is still present at a later time ascontinuing bright light condition 102. The device, for instance acamera, may use its auto exposure to adjust to the bright lightcondition. The auto exposure then slowly takes effect after ten or moreframes and the image used for tracking is still of degraded quality, asdepicted in image 112. At a later point in time, bright light condition102 is now bright light condition 103 and the auto exposure is workingafter about fifteen frames, and the image used for tracking is of betterquality as depicted in image 113.

Next, a light condition change at time point 121 may occur whereby thelighting becomes darker than at bright light condition 103. The changemay be back to the previous normal lighting condition 100 as is shown bythe change back to normal light condition from the bright lightcondition 104. At this point, the image may be underexposed and theimage used for tracking is thus of degraded quality and may be asdepicted in darkened image 114. At a later point in time, under normallight condition 105, the auto exposure may be working after aboutfifteen frames and the image used in the tracking system may be ofbetter quality as shown in image 115. As shown, this conventionalprocess for capturing images over time as a dramatic change in lightingoccurs reacts fairly slowly to the changing illumination conditions.

In contrast to the process of FIG. 1, FIG. 2 depicts an embodiment of acompensated exposure process and the resulting image frames producedthereby. Compensated images are shown as they may appear in someembodiments relative to an original image. In some embodiments, theimage is input to a tracking system. The column on the left of FIG. 2shows embodiments of images as they appear without exposurecompensation, while the column on the right shows compensated imagesthat may be input to a tracking system.

The compensated images on the right column of FIG. 2 may be producedusing the devices and methods disclosed herein. For example, an originalimage input for a tracker under normal light conditions may appear asimage 200. Using an exposure compensation method or device, acorresponding compensated image under normal light conditions may appearas image 202. As the lighting condition is normal for original image200, the compensated image 202 may appear the same or similar tooriginal image 200.

However, under a bright light condition, an original image may appear asdepicted in image 204. With auto exposure, the bright light condition inimage 204 may not be adjusted enough to reliably track an item undersuch conditions. A compensated image may improve the tracker capability.The compensated image 206 may be input to the tracking system andproduce more reliable tracking. As the light changes back to normalconditions, an original image may appear as depicted in image 208. Thisoriginal image 208 is less than optimal for a tracking system.Therefore, the compensated image 210 may be used as a better input imagefor the tracking system.

The images shown in FIG. 2 are embodiments of how some image frames mayappear. Other image frames may appear differently. The images shown arefor the sake of illustration only. Other images with brighter or darkerappearances, or with other varied attributes, may be used in the methodsand systems disclosed herein and are within the scope of the presentdisclosure.

FIGS. 3A-3B depict embodiments of image frames 300, 302 produced by arecording device with a tracking system having exposure compensation andstabilization. The frame 300 in FIG. 3A depicts a tracked object 305,such as a flying bird, in lighting conditions 320. The lightingcondition 320 may be lighter or darker compared to the frame 302 asshown in FIG. 3B, which is also tracking the object 305 in lightingconditions 320. The frames 300, 302 depict the tracked object 305 insidea region of interest 310 having a lighting intensity 315. The intensityinside the region 310 in FIG. 3B is lighter than the region 310 in FIG.3A as the object being tracked in frame 302 is now nearer to a brightlight source, the sun. Outside the region 310, the frames 300 havelighting intensity 320, which may be the same or different from theintensity 315 inside the region 310.

FIG. 3A depicts the tracked object 305 in a first position at a momentin time, while FIG. 3B depicts the same tracked object 305 in adifferent position and/or orientation at a later moment in time.“Position” and/or “orientation” as used herein may refer to meremovement or translation of the object 305, either in the plane of theframe 300 and/or into and/or out of the plane of the frame 300. Positionand orientation may also refer to rotations or other movements of theobject 305. Any conceivable movement of the object 305, includingvibratory movement and/or smooth movement, is within the scope of thepresent disclosure and may be denoted by such terms as position,orientation, location, coordinates, and the like. Further, suchmovements refer to relative movement between the object 305 and thedevice creating the frame 300. For instance, in some embodiments, thedevice may be stationary while the object 305 is moving. In someembodiments, the device may be moving while the object 305 isstationary. In some embodiments, both the device and the object 305 maybe moving. Further, such movement may be due to zoom features of therecording device. For example, an object 305 may appear to move fartheraway or closer in frame 300 due to zooming out or in, respectively, onthe object 305. Any combination of movements, or features of therecording device, that produces the frames 300, 302 and that results inapparent relative motion of the object 305 with respect to the recordingdevice, is contemplated.

In FIG. 3A, the region of interest 310 has been defined that capturesthe tracked object 305. As discussed in further detail herein, forexample with respect to FIGS. 6 and 10A-10H, the region of interest 310may be defined automatically or manually by selecting the object 305 totrack. As shown in FIG. 3A, the region 310 surrounds the object 305 witha rectangular shaped-box having a width and a height. In a preferredembodiment, the region 310 captures the object 305 in a manner thatallows for maintaining the object 305 inside the region 310 as theobject 305 moves. For instance, the region 310 may be sized such that itcaptures the object 305 and also provides an extra margin around theobject 305 to ensure full capture of the object 305 in the region 310.Therefore, in some embodiments, the region 310 may fully encompass theobject 305, as shown. Further, in some embodiments, the region 310 maypartially capture the object 305, for example while the object 305 ismoving and the region 310 is responding to the movement of the object305.

In still other embodiments, the region 310 may capture a larger area ofthe frame 300 than is shown. For example, the region 310 may be largerdue to a larger specified margin in order to ensure that the object 305is captured. “Margin” here refers to its usual and ordinary sense,including an extra enlargement of the region beyond what is necessary tocapture only the object 305. For instance, the region 310 may berectangular and sized based on the width of the object 305 as shown. Theregion 310 may also be sized based on the height of the object 305.Other embodiments and configurations of the region 310 that capture theobject 305, although not explicitly addressed or shown herein, arewithin the scope of the present disclosure. For instance, a region 310that is more or less than four-sided, such as a circle, triangle, orother polygon, is contemplated. Further, the region 310 may conform tothe shape of the object 305 being tracked, for instance by having ashape or contour that is the same as or similar to the object 305.

Referring to FIG. 3B, the frame 302 shows the object 305 being trackedby the region of interest 310 as the object 305 is near the sun, abright light source. As shown, the object 305 is now closer to the sunand is therefore in a brighter area. Therefore, the intensity insideregion 310 is brighter in frame 302 as compared to frame 300. Otherchanges in lighting intensity in the frames 300, 302 are possible. Forinstance, the lighting condition 320 may be brighter in frame 302compared to frame 300. A relatively brighter lighting condition 320 ofFIG. 3B may be due to a number of factors, including for example changesin the ambient lighting. Changes in the lighting 320 may be due to, forexample, moving the recording device from a lighter to a darkerlocation, changes in the environment such as introducing cloud cover ora setting sun, removing brighter light sources such as the sun or otherlight sources, shading the recording device, moving the recording deviceor object 305 from inside a dark building to outside in the daylight,etc.

While the intensity inside region 310 and/or lighting condition 320 asdiscussed here may move from darker to lighter conditions over time,other variations in lighting changes are contemplated. In someembodiments, the intensity inside region 310 and/or lighting condition320 may change from lighter to darker. In some embodiments, theintensity inside region 310 and/or lighting condition 320 may changefrom darker to lighter to darker, or from lighter to darker to lighter,etc. Other variations in the changing intensity inside region 310 and/orlighting condition 320, even though not explicitly addressed or shown,are contemplated and are within the scope of the present disclosure.

The region of interest 310 as shown in FIG. 3B fully captures the object305. The object 305 has moved from left to right from frame 300 to frame302 as shown. This movement may be due to movement of the object 305,and/or of the recording device, and/or zoom features of the device, orany combination thereof. Further, the object 305 and region 310 as shownin frame 302 of FIG. 3B are smaller with respect to the object 305 andregion 310 as shown in frame 300 of FIG. 3A. As mentioned, this may bedue to the object 305 moving farther from the recording device, and/orthe recording device moving farther from the object 305, and/or therecording device zooming out from the object 305, and/or other movementsdiscussed herein, or any combination thereof.

In some embodiments, the region of interest 310 may automatically changesize and/or shape as it tracks the object 305. For instance, the region310 as shown in FIG. 3B is rectangular with reduced width and heightdimensions relative to FIG. 3A. The region 310 of FIG. 3B has relativelysmaller width and height, and other changes to the size are possible aswell, for instance larger width and height. In some embodiments, as theregion 310 tracks the object 305, the region 310 may vary in shape aswell. For instance, the region may morph or otherwise alter its shape toaccord with the object 305 being tracked as the object 305 changes shapeas viewed in the frame 300. This may be due to the object 305 actuallychanging shape in reality or it may be merely viewed as such by theframes 300, 302, for example if the object 305 rotates relative to therecording device. Other shapes of the region 310 are possible as well,for instance those discussed above.

Further, the change in location or size of the region 310 from one frame300 to another frame 302 may be of varying amounts. For example, theregion 310 may change slightly from one frame to another, or the region310 may change dramatically, or any amount in between, or not at all.Thus the changes to the region 310 may be in varying amounts.Determination of the amount of change in the size, location, etc. of theregion 310 may be done by calculating a variation indicator based onthese changes, as is discussed in further detail herein, for examplewith respect to FIGS. 6 and 10A-10H.

The changes of region 310 in location, size, shape, and/or in any otherattributes, as the region 310 tracks the object 305, may be recordedand/or used as historical region data or parameters. As is discussed infurther detail herein, for example with respect to FIGS. 7 and 10A-10H,such data may be used in some embodiments of the tracking methoddisclosed in order to stabilize the tracking system.

Further, any references to changes in any single attribute of the region310, for instance location, include in its meaning changes to any otherattributes of the region 310, such as size or shape. Therefore, forinstance, while a change in “location” of the region 310 may bereferenced in the present disclosure, it is understood that thislanguage encompasses changes in size, shape, orientation and/or anyother attribute of the region 310 as well.

While the object 305 may stay within the frames 300, 302 from FIG. 3A to3B, in some embodiments it may also leave after frame 300 and return inframe 302. In some embodiments, the frames 300 and 302 may not beconsecutive but may be separated by a large amount of time. In someembodiments, the tracking system and methods disclosed herein mayrecognize the object 305 when it returns to the field of view of therecording device. Thus, the object 305 may be tracked in frame 300 whenit is visible, then not tracked in between frames 300 and 302 while itis not visible, and then tracked again in frame 302 when it is visibleagain. The object 305 may not be visible because it left the field ofview of the recording device, or for any other reasons, for instance itmay be obscured by another object in the image frame.

As shown in FIGS. 3A and 3B, the lighting intensities inside the region310 are referred to as lighting intensity 315. In some embodiments, thisintensity 315 is the average lighting intensity captured in the region310. For instance, the intensity of all or most pixels in the region 310may be determined and then averaged. In some embodiments, the lightingintensity 315 may be an average from a sampling of fewer than most ofthe pixels inside the region 310. In some embodiments, the lightingintensity 315 may be a mere sampling without any averaging or othercalculation performed. In other embodiments, the lighting intensity 315may be some other calculation other than averaging performed on all,most, or some of the pixels in the region 310 that is indicative of thelighting intensity in the region 310. Other sample sizes of the pixelscaptured in the region 310 and other calculations may be performed andcan be represented as the lighting intensity 315. These are just some ofthe operations and sample sizes, but others are within the scope of thepresent disclosure as well. Further details of some embodiments of suchcalculations are described herein, for example with respect to FIGS.6-8.

As shown in FIGS. 3A-3B, the tracked object 305 has moved from arelatively darker location in frame 300 in FIG. 3A to a relativelylighter location of frame 302 in FIG. 3B. The lighting intensity 315inside the region 310 in FIG. 3A is thus darker as compared to thelighting intensity 315 inside the region 310 in FIG. 3B. As shown, thisis due to the changes in the ambient lighting condition 320 as theobject in FIG. 3B is now closer to the line of sight of the sun.However, as discussed above, the changes of lighting intensity 315inside the region 310 may be due to a variety of other factors, such asmoving the recording device from a darker indoors to a lighter outdoors,etc.

Further, this change in the lighting intensity 315 from one frame 300 toanother may be of varying amounts. For example, the lighting intensity315 may change slightly from one frame to another, or the lightingintensity 315 may change dramatically. This latter situation, i.e.changes to the lighting intensity 315 that are dramatic, may be referredto herein in multiple manners, all of which denote the same idea. Forinstance, such “dramatic” changes in lighting intensity 315 may bereferred to as major, great, large, severe, intense, big, abnormal, etc.Similarly, changes that are not dramatic may be referred to herein invarious manners, for example as minor, small, undramatic, slight,little, normal etc. Determination of whether a change in lightingintensity 315 is large or small may be done by comparing the change inlighting intensity 315 to an intensity limit, as discussed in furtherdetail herein, for example with respect to FIGS. 6-8.

The tracking system, devices and methods disclosed herein address theaforementioned changes to the lighting condition 320 and/or lightingintensity 315, whether dramatic or otherwise, and the aforementionedchanges to the region of interest 310. Such changes in lightingintensity are addressed in part by exposure compensation of the lightingintensity levels of a current image frame. FIG. 4A is a chart showingembodiments of changing lighting intensity levels along withcorresponding compensated intensity levels. FIG. 4B is a chart showingembodiments of how a reference value, which may be used in thecompensation devices and methods, changes with respect to the changinglighting intensity levels shown in FIG. 4A. Details of how thecompensated intensity is achieved by using the reference value arediscussed in further detail herein, for example with respect to FIGS.6-8, while FIGS. 4A-4B show how these values may be changing in responseto changed lighting conditions. The values shown are exemplary of anembodiment of the present disclosure and are not meant to providequantitative requirements. Instead, the values shown in FIGS. 4A-4B areused to describe representative qualitative relationships between them,as will now be discussed.

FIGS. 4A-4B therefore depict how the compensated intensity level and areference value may change under changing original lighting conditions.In particular, FIG. 4A depicts how the original intensity level (forinstance, lighting intensity 315 from FIGS. 3A-3B) and a compensatedintensity level may change. The vertical axis in FIG. 4A may beintensity value and the horizontal axis may be time or frames measuredover time. FIG. 4B depicts how the reference value may change. Thevertical axis in FIG. 4B may be intensity for the reference value andthe horizontal axis may be time or frames measured over time.

Further, the horizontal axes of FIGS. 4A and 4B may be aligned, suchthat a given frame or point in time from FIG. 4A corresponds to the sameframe or point in time in FIG. 4B. For instance, the horizontal axis ofFIG. 4A contains labels beginning at a value of “0” and ending at “250.”Likewise, the horizontal axis of FIG. 4B contains labels beginning at avalue of “0” and ending at “250.” These labels on the horizontal axes ofFIGS. 4A and 4B represent the same frames or points in time.

In FIG. 4A, the original intensity level is shown by a dashed line, forexample at 406. The compensated intensity level is shown by the solidline, for example at 405. FIG. 4B depicts how the reference value maycorrespondingly change and is shown, for example, by the line 400. Forexample, the reference value may initially be equal to the originalintensity level. Then, as shown in FIGS. 4A-4B, under normal lightingconditions where the intensity is not dramatically changing, and asdiscussed in further detail herein with respect to FIG. 8, the referencevalue may update periodically to match the original intensity level asit changes. Such a period of periodic updating is shown over the period426 identified in FIG. 4B, which corresponds to the first “normal light”condition denoted in FIG. 4A. During this time, as seen in FIG. 4A, theoriginal intensity level is not dramatically changing. Therefore, thecompensated intensity level has a similar value as the originalintensity level, as shown by, for example, the location 402 in FIG. 4A.The reference value is periodically updating, but only in preparationfor a dramatic change in lighting. Because the light in period 426 isnot dramatically changing, the reference value is not being used tocompensate the intensity and thus the compensated intensity level issimilar to the original intensity level. Thus, the compensated intensitylevel over time stays relatively flat and consistent with the originalintensity level.

After the period 426 of normal light, the lighting condition may thenchange dramatically. Under a first bright light condition, for exampleon FIG. 4A at location 404, the change shown is dramatic. From 404, theoriginal light intensity may jump dramatically as shown by location 406.FIG. 4B depicts this period of dramatic changes in light at period 428.The reference value may then stop updating periodically, as shown by theflat line 400 over the location denoted by period 428. Once thereference value 400 stops updating periodically, then the compensatedintensity level is as shown in FIG. 4A at 405, because the image iscompensated using the reference value. The original intensity level isbeing affected by the auto exposure as shown at 408, but it is notadequately responsive for the tracking system.

The lighting condition may then change back to a normal lightingcondition and the original intensity level may drop to the value shownat 410. This may cause a slight change in the compensated level as shownat 410. This is due to the particular timing and threshold levels usedin the exposure compensation system. The slight change may be negative,as shown, or positive. The original intensity level is now at 412 whilethe compensated intensity level is at 411 due to the reference value, asdepicted in FIG. 4B, remaining constant.

Another bright light condition may follow, for example on FIG. 4A atposition 414, and the change again may be dramatic. From 414, theoriginal light intensity may jump dramatically as shown, for example, bylocation 416. FIG. 4B depicts this period of dramatic changes in lightat period 428. The reference value may still not be updatingperiodically, as shown by line 400 over period 428. Once the referencevalue 400 stops updating periodically, then the compensated intensitylevel is as shown in FIG. 4A at 415, because the image is compensatedusing the reference value. The original intensity level is beingaffected by the auto exposure as shown at 418, but it is not adequatefor the tracking system.

The lighting condition may then change back to a normal lightingcondition and the original intensity level may drop to the value shownat 420. This may cause a slight change in the compensated level as shownat 420. This is due to the particular timing and threshold levels usedin the exposure compensation system. The slight change may be positive,as shown, or negative. The original intensity level is now at 422 whilethe compensated intensity level is at 421 due to the reference value, asdepicted in FIG. 4B, remaining constant.

Another normal light condition may follow, and the original intensitylevel may increase to the level shown in FIG. 4A at 424. At 424, thereis no more dramatic change in lighting condition, and thus the referencevalue may begin to periodically update again as shown in FIG. 4B at 430.The compensated intensity level may be as shown at 424 in FIG. 4A.

The relationships discussed above between the original intensity level,the compensated intensity level, and the reference value due to changinglighting conditions are merely exemplary. Other variations in thesevalues are possible and are within the scope of the present disclosure.For instance, while dramatic lighting conditions involving brighterlighting have been discussed, it is understood that dramatic lightingconditions involving darker lighting are also contemplated. The use ofdramatically brighter lighting with respect to FIG. 4 is forillustration only and does not limit the scope of the presentdisclosure. These various changes in lighting may be compensated by, andthese various relationships between the lighting and the reference valuemay be employed in, a variety of devices and tracking systems. One suchdevice will now be described.

FIG. 5 depicts a block diagram of a digital imaging device 500comprising a tracking system with exposure compensation andstabilization. The device 500 has a set of components including aprocessor 520 linked to an imaging sensor 515. A working memory 505,storage 510, electronic display 525, and memory 530 are also incommunication with the processor 520.

Device 500 may be a cell phone, digital camera, personal digitalassistant, tablet, or similar apparatus having at least one imagingsensor. The device 500 may also be a more stationary device such as adesktop personal computer, video conferencing station, or the like. Aplurality of applications may be available to the user on device 500.These applications may include traditional photographic applications,high dynamic range imaging, panoramic video, or stereoscopic imagingsuch as 3D images or 3D video.

Processor 520 may be a general purpose processing unit or a processorspecially designed for imaging applications. As shown, the processor 520is connected to a memory 530 and a working memory 505. In theillustrated embodiment, the memory 530 stores an imaging sensor controlmodule 535, object of interest detection module 540, touch screen inputmodule 555, settings management module 560, window display module 570,preview control module 575, operating system 580, light measurementmodule 585 and tracking module 590. These modules include instructionsthat configure the processor to perform various image processing anddevice management tasks. Working memory 505 may be used by processor 520to store a working set of processor instructions contained in themodules of memory 530. Alternatively, working memory 505 may also beused by processor 520 to store dynamic data created during the operationof device 500.

As mentioned above, the processor is configured by several modulesstored in the memories. The imaging sensor control module 535 includesinstructions that configure the processor 520 to adjust the focusposition of imaging sensor 515. The imaging sensor control module 535also includes instructions that configure the processor 520 to captureimages with imaging sensor 515. Therefore, processor 520, along withimage capture control module 535, imaging sensor 515, and working memory505 represent one means for capturing an image using an imaging sensor.The object of interest detection module 540 provides instructions thatconfigure the processor 520 to detect an object of interest in theimages captured by imaging sensor 515. In some embodiments, an object ofinterest may be a tracked object. Touch screen input module 555 mayinclude instructions that configure the processor 520 to receive touchinputs from a touch screen display, for example, display 525. Settingsmanagement module 560 may include instructions to manage variousparameter settings for device 500. For example, parameters related tothe configuration of the preview window may be managed by module 560.Window display module 570 may include instructions to manage the layoutof data within the preview window generated on display 525 within device500. For example, the preview window may include more than one image“window” within it. Some “windows” may display data at differing scales.Instructions within window display module 570 may configure theprocessor to translate data related to each of these sub windows intodisplay commands for display 525.

Preview control module 575 includes instructions that configure theprocessor to display a preview window on electronic display 525according to the methods described herein. For example, preview controlmodule 575 may include instructions that call subroutines in imagingcontrol module 535 in order to configure the processor 520 to capture afirst image using imaging sensor 515. Preview control module 575 maythen call object of interest detection module 540 to detect objects ofinterest in a first image captured by imaging sensor 515. Instructionsin preview control module may then invoke settings management module 560to determine how the operator has configured the preview window todisplay on display 525. This information may be provided to windowdisplay module 570, in order to layout the preview window as configuredusing the image data captured by imaging sensor 515 and the object ofinterest information determined by object of interest detection module540. Window display module 570 may invoke instructions in operatingsystem 580 to control the display and cause it to display theappropriate preview window configuration on electronic display 525.

Operating system module 580 configures the processor to manage thememory and processing resources of device 500. For example, operatingsystem module 580 may include device drivers to manage hardwareresources such as the electronic display 525, storage 510, or imagingsensor 515. Therefore, in some embodiments, instructions contained inthe preview image processing modules discussed above may not interactwith these hardware resources directly, but instead interact throughstandard subroutines or APIs located in operating system component 580.Instructions within operating system 580 may then interact directly withthese hardware components.

Processor 520 may write data to storage module 510. While storage module510 is represented graphically as a traditional disk device, those withskill in the art would understand multiple embodiments could includeeither a disk based storage device or one of several other type storagemediums to include a memory disk, USB drive, flash drive, remotelyconnected storage medium, virtual disk driver, or the like.

Although FIG. 5 depicts a device comprising separate components toinclude a processor, imaging sensor, and memory, one skilled in the artwould recognize that these separate components may be combined in avariety of ways to achieve particular design objectives. For example, inan alternative embodiment, the memory components may be combined withprocessor components to save cost and improve performance.

Additionally, although FIG. 5 illustrates two memory components, toinclude memory component 530 comprising several modules, and a separatememory 505 comprising a working memory, one with skill in the art wouldrecognize several embodiments utilizing different memory architectures.For example, a design may utilize ROM or static RAM memory for thestorage of processor instructions implementing the modules contained inmemory 530. Alternatively, processor instructions may be read at systemstartup from a disk storage device that is integrated into device 500 orconnected via an external device port. The processor instructions maythen be loaded into RAM to facilitate execution by the processor. Forexample, working memory 505 may be a RAM memory, with instructionsloaded into working memory 505 before execution by the processor 520.

Some devices 500 may have exposure compensation and stabilizationcapabilities. This allows the device 500 to track an item as it movesrelative to the field of view of the device 500 in a stable manner andto compensate for dramatic changes in lighting conditions. In someembodiments, toward these ends the device 500 may include a lightmeasurement module 585 and tracking module 590.

Tracking module 590 includes instructions that configure the processorto track an object in a preview window on the electronic display 525according to the methods described herein. For example, tracking module590 may include instructions that call subroutines in imaging controlmodule 535 in order to configure the processor 520 to capture a firstimage using imaging sensor 515. Tracking module 590 may then call objectof interest detection module 540 to detect and then track objects ofinterest in a first image captured by imaging sensor 515. Instructionsin preview control module 575 may then invoke settings management module560 to determine how the operator has configured the preview window, forexample for the region of interest, to display on display 525. Thisinformation may be provided to window display module 570, in order tolayout the region of interest as configured using the image datacaptured by imaging sensor 515 and the object of interest informationdetermined by object of interest detection module 540. Window displaymodule 570 may invoke instructions in operating system 580 to controlthe display and cause it to display the appropriate preview windowconfiguration on electronic display 525.

The device 500 may implement compensation in various ways. For instance,the image 500 or 504 or 508 may be sensed by the imaging sensor 515 andcommunicated to the processor 520. The imaging sensor control module 535or the object of interest detection module 540 may analyze the averagelighting intensity in a tracked region of interest to calculate areference value 405, for example. Operations carried out using thereference value, for instance subtracting the reference value from acurrent bright light condition intensity value, may be carried out bythe operating system 580 or the processor 520. The data may be stored inthe working memory 505 or storage module 510. The data may also be inputto the tracking system in a window display module 570 or preview controlmodule 575. These modules may input the compensated image 502 or 506 or510 to a tracking system in those or any other modules of device 500.

In some embodiments, light measurement module 585 may be used tocompensate for dramatic lighting conditions. Module 585 includesinstructions that configure the processor to measure the light intensityon an electronic display 525 and/or in a region of interest according tothe methods described herein. For example, light measurement module 585may include instructions that call subroutines in imaging control module535 in order to configure the processor 520 to analyze a first imageframe, for example by using imaging sensor 515. Light measurement module585 may then call the object of interest detection module 540 to detectobjects of interest in a first image captured by imaging sensor 515, forexample a region of interest. Either module 585 or 540 may then analyzethe intensity of light in the region of interest, or elsewhere in theimage frame, for instance by comparing lighting intensity levels fromdifferent image frames. The light measurement module 585 may further beconfigured to use the results of such analysis to alter the lightingintensity of an entire image frame. For instance, the light measurementmodule 585 may call the settings management module 560 or previewcontrol module 575 to subtract or add intensity level to an image framein order to compensate for dramatic changes in lighting conditions.These or other modules may further include instructions that configurethe processor to send the image frame to the tracking system. Further,these or similar operations may be carried out on other image frames inorder to carry out the compensation methods disclosed herein.

Many other variations of operations and the modules used in carrying outthe operations may be implemented. Further, any of the functions in themodules may be carried out by various modules and need not be limited tojust one module for one capability. The functionalities recited of thevarious modules are not the sole modules or components capable ofcarrying out the aforementioned functions but are merely listed asexamples of how the disclosed features may be implemented.

The systems and devices disclosed herein may use a variety ofcompensation and stabilization methods. FIGS. 6-8 are flow charts ofdifferent embodiments of methods for exposure compensation andstabilization for tracking, while FIGS. 9 and 10A-10H show details ofcomputational tools that may be employed in some steps of someembodiments of these methods.

Referring to FIG. 6, an embodiment of a method 600 of initializingcertain embodiments of a tracking system is shown. The method 600 maybegin with step 610 wherein selection of an object to be tracked isreceived. In some embodiments, selection is done manually. For example,a user may select an object 305 to track from image frame 300. In animplementation, the frame 300 is displayed on a touch screen and a usertouches the area of the screen where the object 305 is located. In someembodiments, confirmation of the object 305 to be tracked is given.

A region of interest 310 may then be defined in step 620. The region 310may circumscribe the object 305 on the display 125. In some embodiments,the definition of the region 310 may be automatic. For instance, theobject 305 may be automatically recognized in the first instance, forexample by analyzing objects in the field of view, comparing them topre-specified object descriptions, and recognizing objects that matchthose descriptions. In some embodiments, the object 305 is automaticallyrecognized after it leaves and then returns to the field of view of therecording device and is shown again in frame 300.

Further, for step 620 the region 310 may be defined with various shapesand/or sizes. In some embodiments, these shapes and/or sizes may beautomatically generated based on characteristics of the object 305, suchas the shape, size, movement, or other attributes of the object 305. Insome embodiments, the shape or size of the region 310 may be specifiedby a user. For instance, a user may specify a particular shape, such asa rectangle, and a margin, such as an inch, for the region of interest310. The region 310 would then take on rectangular shapes and leave aninch margin around the object being tracked. Other variations andconfigurations for the selection of the object 305 to be tracked and fordefinition of the region of interest 310 in which to track the object,although not explicitly addressed herein, are within the scope of thepresent disclosure.

The method 600 may next move to step 630 wherein an initial referencevalue is defined as the average light intensity of pixels in the regionof interest 310. The intensity may refer to a value corresponding to thebrightness of the pixels. In an implementation, all or most of thepixels contained in the region 310 are measured and an average iscomputed based on the measurements. In some embodiments, an averagelight intensity is computed based on fewer than most pixels in theregion 310. In some embodiments, other calculations indicative of thebrightness or intensity are performed on the pixels measured in theregion 310. Further, the light may be analyzed in areas of the imageframe besides the region of interest 310. For instance, if the intensitymeasured inside the region 310 results in an error, then pixels adjacentto or farther from the region 310 may also be measured and used in thecomputations.

After defining an initial reference value in step 630, the method 600may move to step 640 wherein the initial size and location of the regionof interest 310 are determined. The initial size may include, forexample, the height and width of a rectangular region 310. The initiallocation may include, for example, coordinates of a central point of theregion 310. In some embodiments, the location of the region 310 is givenin X and Y coordinates, where X represents a horizontal coordinate and Yrepresents a vertical coordinate, for example, of the frame 300. Asmentioned, it is understood that size and location includes otherparameters related to the region 310, such as area, contour, shape, etc.

The location of the region 310 may be used as a tracking position forthe tracking system. Thus an initial tracking position could be definedas the location or coordinates of the center of the region 310 in animage frame 300. In another frame, for instance frame 302, the trackingposition could change to the changed coordinates of the center of region310 in frame 302. Similar operations may be performed to define aninitial size, area, shape, etc.

The initialization performed by method 600 may further be done in otherorders and need not be carried out in the order described above. Forinstance, the initial size and location of the region in step 640 may beperformed before the reference value is defined in step 630. Othervariations to the order of the steps in method 600 are possible and arewithin the scope of the present disclosure. Further, the method 600 mayoccur repeatedly, such that multiple values for size, location, etc. aredetermined and stored. For example, the method 600 may be repeated seventimes such that seven entries for the reference value are stored, witheach value corresponding to an image frame in the past. Further, forexample, seven entries for the size and location of the region 310 maylikewise be stored as historical parameters. These historical parametersmay then be used to stabilize the tracking system, as described infurther detail with respect to FIGS. 7 and 10A-10H.

After the historical parameters for the reference value and the regionof interest 310 have initially been defined, for instance as describedabove with respect to FIG. 6, other methods relating to compensating andstabilizing a tracking system may be performed. An overview of anembodiment of one such method 700 is shown in FIG. 7.

FIG. 7 depicts an overview of an embodiment of a method 700 for trackingwith exposure compensation and stabilization features. The method 700may begin with step 710 by receiving a current image frame. The currentimage frame, such as frame 302, may be supplied by a recording device.Next, in step 720, any dramatic changes in lighting in the frame may becompensated. For instance, frame 204 under a bright light condition maybe compensated as frame 206. After compensation, the method 700 moves tostep 730 wherein a tracking position is stabilized based on thehistorical parameters. As discussed, the tracking position may be thecenter of a region 310. Thus, in some embodiments, the center of theregion 310 may be stabilized using historical parameters, which mayinclude the location and size of the region 310. After stabilization,the current image frame is transmitted to the tracking system in step740.

The above description is an overview of an embodiment of a method ofexposure compensation and stabilization. Details of the method will nowbe described with respect to the embodiment of method 800 shown in FIG.8.

Once the reference value or values, and the historical parameter orparameters of the region 310, have been defined in method 700, themethod 800 for continued compensation and stabilization as shown in FIG.8 may be performed. However, it is understood that the method 800 mayincorporate the method 700. Further, sequential discussion of methods700, 800 is not meant to imply any order in carrying them out.

As shown in FIG. 8, the method 800 may begin with step 815 wherein thelight intensity of the pixels in the region for the current image frameare measured. In some embodiments, the light intensity for all or mostof the pixels are measured and an average is computed. Next, in step817, the difference between the reference value and the averageintensity (from step 815) is calculated. In some embodiments, thisdifference is calculated by subtracting the reference value from theaverage intensity.

In the next step 820, the difference calculated in step 817 is analyzed.In some embodiments of step 820, the relationship of the difference toan intensity limit is determined. A shown, in step 820 it may bedetermined whether the difference is greater than the intensity limit.The intensity limit may be specified by a user or automaticallyconfigured.

If the difference is greater than the intensity limit, then the processmoves to step 825 to adjust the image frame. As shown, in someembodiments of step 825, the image frame is adjusted by subtracting thedifference from the entire image frame. For example, the brightnessvalue for every pixel in the image frame 302 will have the differencesubtracted from it. If this difference was a positive value, meaning theaverage intensity was greater than the reference value, then each pixelin frame 302 will appear darker after the subtraction. This may be seenin FIG. 2 in original frame 204 and the relatively darker compensatedframe 206. Conversely, if the difference was a negative value, meaningthe average intensity was less than the reference value, then each pixelin frame 302 will appear lighter after the subtraction. This situationmay be seen in FIG. 2 in original frame 208 and the relatively lightercompensated frame 210. After step 825, the process 800 moves to step 840where a variation indicator is calculated, as discussed below.

If the difference calculated in step 817 is not greater than theintensity limit, then the process moves to step 830. In step 830, it isdetermined whether it is time to update the reference value. In someembodiments, the reference value is updated periodically. It may beupdated every second, every few seconds, every minute, or some portionthereof. The period of update may be specified by a user or it may beautomatically configured. If it is time to update the reference value,the method 800 moves to step 835, where the reference value is reset orredefined to the average light intensity of pixels in the region ofinterest for the current image frame. “Reset” here does not necessarilymean it is set to a previous value or to zero. It merely means that itis redefined or set again to a value based on the intensity of pixels inthe region of interest for the current image frame, which may or may notbe the same as a previous reference value. If it is not time to updatethe reference value, the method 800 instead moves to step 840.

In step 840, a variation indicator is calculated based on changes toattributes of the region of interest. In some embodiments, as shown,these attributes are parameters that include the size and/or location ofthe region. The variation indicator may represent the degree ormagnitude as well as the direction of change of the region's parameters.For instance, if the region has increased in size by a large amount,then the variation indicator may be positive and large. In someembodiments, if the region has moved in a particular direction by aparticular amount, the indicator may reflect this. For instance, atypical X-Y coordinate system, where values are positive to the rightand up and negative to the left and down, may be used. If the movementis to the right and up, then the indicator may be positive. Further, ifthe movement to the right and up is large, then the indicator maylikewise be large. Opposite values may be given for opposite changes.Calculation of the variation indicator using an X-Y coordinate system isdescribed in further detail herein, for example, with respect to FIG. 9.

In some embodiments, the indicator may capture changes in the size ofthe region. For example, the rectangular region 310 in frame 300 has afirst width and height. The region 310 in frame 302 has a second widthand height that are larger than the first width and height. This changein size may be characterized by subtracting the dimensions in frame 300from the dimensions in frame 302.

In some embodiments, the variation indicator may be a vector. The vectormay be indicative of magnitude and direction of the changes to theregion. In some embodiments, arrays may be used to record the changes tomultiple attributes or to details of attributes. For instance, a firstcolumn of the array may include data on the horizontal size of arectangular region, a second column may include data on the verticalsize of a region, a third column may include data on the direction ofmovement of the region, and a fourth column may include data on themagnitude of the movement of the region. All of these values mayindividually be used in the method 800, or a final variation indicatormay be used that is calculated based on some or all of the variousvalues. Other variation indicators may be implemented for the variousshapes, sizes, locations, etc. that the region may possess.

In some embodiments, multiple variation indicators may be determined andstored. For instance, the initialization method 600 may have beenrepeated. Or, method 800 may be repeating and storing the variationindicator each time the method 800 is performed. In some embodiments, avariation indicator is stored for each frame that is analyzed. In someembodiments, only a limited number of past variation indicators arestored, such as five, ten, twenty, one hundred, etc., such that only acertain number of the most recent past indicators, along with thecurrent indicator, are stored.

Once a variation indicator has been calculated, the method 800 moves tostep 845 and calculates a confidence level based on the variationindicator. In some embodiments, the confidence level is calculated basedon historical values of the indicator. For instance, if the variationindicator is similar to a recent set of indicator values, then a higherconfidence level results. This is due to the fact that the methodascribes a higher confidence that the change in the region is due tomovement of the object if the changes are similar to those as have beenrecently measured. Conversely, if the current indicator is not similarto a recent set of indicator values, then a lower confidence levelresults. A low confidence indicates that the change in the region islikely not due to movement of the object, but rather to other factorssuch as shaking or jitter of the recording device. Further detail of thecalculation of the confidence level based on historical variationindicators is described herein, for example with respect to FIGS. 9 and10A-10H.

Once a confidence level is calculated, the method 800 moves to step 850wherein a weighting or gain is calculated based on the confidence level.The gain is then used to calculate the gain filter in step 855. Then, instep 857, the gain filter is applied to the tracking position. In someembodiments, the tracking position is the location and/or size of theregion 310. After applying the gain filter, then the method 800 moves tostep 860 wherein the image frame 302 is passed to the tracking system.In some embodiments, the method 800 may repeat for the next image frame.Further detail of the calculation of the confidence level, the gain andthe gain filter, as well as applying the gain filter to the region 310,are described below and with respect to FIGS. 9 and 10A-10H.

FIG. 9 depicts an embodiment of a computational tool that may be used tocalculate the variation indicator and obtain a confidence level.Therefore, the following description may apply to some embodiments ofsteps 840 and 845 in method 800. As shown, a Cartesian X-Y coordinatesystem 910 may be used. The system 910 has a horizontal X axisintersecting a vertical Y axis, with the arrows on the axes indicatingtheir respective positive directions. Two diagonal lines also intersectthe axes such that eight areas 900-907 are defined. Therefore, forexample, some movements with positive X and Y values may be movements inthe direction 920 which is into the area 906.

Movements of the region 310 may be calculated using the coordinates fromtwo image frames. As mentioned, the location of a region 310 in an imageframe 302 may be represented by coordinates that correspond to thecenter of the region 310. Movement of the region 310 from one imageframe 302 to the next may be calculated by subtracting the previouscoordinates from the current coordinates. For instance, the center ofthe region in the current image frame, represented by t₀, may have X-Ycoordinates of (X₀,Y₀)=(3,4). Similarly, the center of the region in theprevious image frame, represented by t⁻¹, may have X-Y coordinates(X⁻¹,Y⁻¹)=(1,0). The movement therefore may be represented as thedifference (X₀,Y₀)−(X⁻¹,Y⁻¹)=(3,4)−(1,0)=(2, 4). Therefore, the regionmoved +2 units in the X direction and +4 units in the Y direction. Thisdirection may be indicated on the coordinate system 900, for example, byarrow 905 extending into area 960.

In some embodiments, the change in the X direction may be compared tothe change in the Y direction to determine into which area 900-907 thevariation indicator is positioned. In some embodiments, the sign of theX and Y changes along with the ratio of the magnitude of those changesmay be used. For example, for a movement of +2 units in the X directionand +4 units in the Y direction, the sign of both movements is positive.Further, the ratio of the magnitudes of these changes may be computed asfollows:

$\frac{\left| {\Delta \; X} \right|}{\left| {\Delta \; Y} \right|} = {\frac{|2|}{|4|} = {\frac{2}{4} = 0.5}}$

Therefore, with both X and Y changes positive, and the ratio of themagnitudes less than one, this corresponds to area 906. Similaroperations may be done on other movements to determine which area900-907 to assign to the variation indicator. For instance, if thechange in X is positive, the change in Y is negative, and the ratio isgreater than one, this would correspond to area 905. For variationindicators that are on a boundary of the areas 900-907, one or the otherarea on either side of the boundary may be chosen. For instance, if theindicator is on the X axis, either area 905 or 907 may be chosen. Thismay occur, for example, if either of the changes is zero. In someembodiments, rules are established to handle these and other cases. Onesuch set of rules is shown in Table 1.

TABLE 1 ΔX ΔY |ΔX|/|ΔY| Area <0 <0 <1 900 <0 <0 ≧1 901 <0 ≧0 <1 902 <0≧0 ≧1 903 ≧0 <0 <1 904 ≧0 <0 ≧1 905 ≧0 ≧0 <1 906 ≧0 ≧0 ≧1 907

In some embodiments, the historical variation indicators may be used indetermining the confidence levels ascribed to a current indicator. Insome embodiments, if many of the historical indicators correspond to acertain area 900-907, then a current indicator in that same area 900-907would result in a higher confidence level. For example, if the pastseven frames, which may be represented as {t⁻⁷, t⁻⁶, t⁻⁵, t⁻⁴, t⁻³, t⁻²,t⁻¹}, have all had variation indicators in area 906 for those respectiveframes, which may be represented as {906, 906, 906, 906, 906, 906, 906},then the current indicator 920, which is also in area 906, would resultin the highest confidence level. In some embodiments, the value of theconfidence level is determined by calculating how many of the historicalvariation indicators match the current variation indicator. Continuingthe example, because the current indicator in area 906 matches all sevenhistorical indicators, then the confidence level is eight because thereare eight indicators—the last seven and the current indicator 920—in thearea 906. However, if the current indicator 920 was in the area 900,then it would match zero of the historical indicators, and theconfidence level would thus be one because there is only oneindicator—the current indicator 920—in the area 900. Therefore, in someembodiments, the confidence level is calculated as the number ofinstances of the current indicator 920, where the current indicator 920is included in that number.

In some embodiments, the confidence level may be used to determine thevarious gain values for the current and previous frames. Therefore, thefollowing description applies to some embodiments of step 850 in method800. FIGS. 10A-10H depict embodiments of relationships 1001-1008,respectively, that may be used to convert a confidence level into acurrent gain value. The various relationships 1001-1008 correspond tothe confidence levels one through eight, respectively. Thus, forexample, if the current confidence level is one then relationship 1001as shown in FIG. 10A is used, if the confidence level is two thenrelationship 1002 as shown in FIG. 10B is used, etc. The horizontal axesof the charts 1001-1008 correspond to various gain variables, with “8”corresponding to the current gain variable, “7” as the immediatelypreceding frame, etc. The values for the gain variables may berepresented as { a⁻⁷, a⁻⁶, a⁻⁵, a⁻⁴, a⁻³, a⁻², a⁻¹, a₀}, where the gainvariables respectively represent the gain values for the current frameand the previous seven frames. For instance, frame t⁻⁷ has a gain valuerepresented by a⁻⁷, frame t⁻⁶ has a gain value represented by a⁻⁶, etc.The gain variables are assigned the Y axis values corresponding to themarks 1-8 on the horizontal axes by using the line shown for theappropriate relationship 1001-1008. For instance, if the currentconfidence level is six, then relationship 1006 as shown in FIG. 10F isused. In relationship 1006, the Y axis values which would be assignedfor the gain variables {a⁻⁷, a⁻⁶, a⁻⁵, a⁻⁴, a⁻³, a⁻², a⁻¹, a₀} would be{0.000, 0.002, 0.009, 0.031, 0.086, 0.182, 0.301, 0.386}, respectively.In some embodiments, all gain variables are reassigned new values whenthe relationships 1001-1008 are used. Further, the new gain values mayor may not be the same as previous values. Other values for the gainwill be assigned for other confidence levels.

It is understood that the relationships 1001-1008 shown in FIGS.10A-1011 are for illustration only. Other relationships may be used tocalculate gain values based on the confidence level.

The gain values may then be used in the gain filter. The gain filterweights the current frame according to the gain values that werepreviously determined. For example, for the highest confidence of eight,relationship 1008 as shown in FIG. 1011 is used, whereby all gainvariables have a value of zero except for a₀ and a⁻¹, i.e. the currentframe and the immediately preceding frame, with values of approximately0.982 and 0.018, respectively. This distribution of gain values weightsthe current frame the most, and the previous frame has a very smallweighting, due to the high confidence in the current frame. In someembodiments, the sum of the gain values distributed among the frames is1.

The weighted distribution of gain values {a⁻⁷, a⁻⁶, a⁻⁵, a⁻⁴, a⁻³, a⁻²,a⁻¹, a₀} in the gain filter may be used to stabilize the size and/orlocation of the region 310 for the current frame. Therefore, thefollowing description applies to some embodiments of step 857 in method800. In some embodiments, for the current and previous seven frames, Xand Y coordinates may be stored that correspond to the locations of theregion 310 in those frames. For example, (X⁻⁷,Y⁻⁷) may correspond to theX and Y coordinates of the center of the region 310 in frame t⁻⁷, andthe gain value for a⁻⁷ is thus used to weight those coordinates todetermine stabilized coordinates (X_(S),Y_(S)). Similar weightings maybe done for the other frames and their respective coordinates. Forinstance, a stabilized X_(S) coordinate for the location of the region310 may be determined as follows:

X _(S)=(X ⁻⁷ ×a ⁻⁷)+(X ⁻⁶ ×a ⁻⁶)+(X ⁻⁵ ×a ⁻⁵)+(X ⁻⁴ ×a ⁻⁴)+(X ⁻³ ×a⁻³)+(X ⁻² ×a ⁻²)+(X ⁻¹ ×a ⁻¹)+(X ₀ ×a ₀)

Similar calculations may be done for the Y_(S) coordinate. In thismanner, the current coordinates (X₀,Y₀) for the region 310 may beadjusted to stabilized coordinates (X_(S),Y_(S)). The region 310 is thuslocated at (X_(S),Y_(S)) in the tracking system.

In some embodiments, the historical size of the region 310 is used tostabilize the tracking system. Similar operations as described abovewith respect to the location of the region 310 may be performed on thesize of the region 310. For example, a change in the size of the regionin the current frame t₀ as compared to the previous frame t⁻¹ may becalculated by using the various dimensions of the region 310. Forinstance, the region in the current image frame may have a width ofthree and a height of four and be expressed as the data set(X₀,Y₀)=(3,4). Similarly, the size of the region in the previous imageframe, may have a width of two and a height of five and be expressed as(X⁻¹,Y⁻¹)=(2,5). The change in size therefore may be represented as thedifference (X₀,Y₀)−(X⁻¹,Y⁻¹)=(3,4)−(2,5)=(1, −1). Therefore, the regionincreased in width by 1 unit and decreased in height by 1 unit. Similarcalculations may be done for a number of previous frames such that anumber of variation indicators are defined. The current and historicalvariation indicators may then be used to determine a confidence level, again, and a gain filter as described above.

The logical blocks, modules and flow chart sequences are illustrativeonly. A person of skill in the art will understand that the steps,decisions, and processes embodied in the flowcharts described herein maybe performed in an order other than that described herein. Thus, theparticular flowcharts and descriptions are not intended to limit theassociated processes to being performed in the specific order described.

Those of skill in the art will recognize that the various illustrativelogical blocks, modules, and method steps described in connection withthe embodiments disclosed herein may be implemented as electronichardware, software stored on a computer readable medium and executableby a processor, or combinations of both. To clearly illustrate thisinterchangeability of hardware and software, various illustrativecomponents, blocks, modules, and steps have been described abovegenerally in terms of their functionality. Whether such functionality isimplemented as hardware or software depends upon the particularapplication and design constraints imposed on the overall system.Skilled artisans may implement the described functionality in varyingways for each particular application, but such implementation decisionsshould not be interpreted as causing a departure from the scope of thepresent invention.

The various illustrative logical blocks, modules, and circuits describedin connection with the embodiments disclosed herein may be implementedor performed with a general purpose processor, a digital signalprocessor (DSP), an application specific integrated circuit (ASIC), afield programmable gate array (FPGA) or other programmable logic device,discrete gate or transistor logic, discrete hardware components, or anycombination thereof designed to perform the functions described herein.A general purpose processor may be a microprocessor, but in thealternative, the processor may be any conventional processor,controller, microcontroller, or state machine. A processor may also beimplemented as a combination of computing devices, e.g., a combinationof a DSP and a microprocessor, a plurality of microprocessors, one ormore microprocessors in conjunction with a DSP core, or any other suchconfiguration.

A software module may reside in RAM memory, flash memory, ROM memory,EPROM memory, EEPROM memory, registers, hard disk, a removable disk, aCD-ROM, or any other form of storage medium known in the art. Anexemplary storage medium is coupled to the processor such the processorreads information from, and write information to, the storage medium. Inthe alternative, the storage medium may be integral to the processor.The processor and the storage medium may reside in an ASIC.

While the above detailed description has shown, described, and pointedout novel features of the invention as applied to various embodiments,it will be understood that various omissions, substitutions, and changesin the form and details of the device or process illustrated may be madeby those skilled in the art without departing from the spirit of theinvention. As will be recognized, the present invention may be embodiedwithin a form that does not provide all of the features and benefits setforth herein, as some features may be used or practiced separately fromothers. The scope of the invention is indicated by the appended claimsrather than by the foregoing description. All changes which come withinthe meaning and range of equivalency of the claims are to be embracedwithin their scope.

A person skilled in the art will recognize that each of thesesub-systems may be inter-connected and controllably connected using avariety of techniques and hardware and that the present disclosure isnot limited to any specific method of connection or connection hardware.

The technology is operational with numerous other general purpose orspecial purpose computing system environments or configurations.Examples of well-known computing systems, environments, and/orconfigurations that may be suitable for use with the invention include,but are not limited to, personal computers, server computers, hand-heldor laptop devices, multiprocessor systems, microprocessor-based systems,a microcontroller or microcontroller based system, programmable consumerelectronics, network PCs, minicomputers, mainframe computers,distributed computing environments that include any of the above systemsor devices, and the like.

As used herein, instructions refer to computer-implemented steps forprocessing information in the system. Instructions may be implemented insoftware, firmware or hardware and include any type of programmed stepundertaken by components of the system.

A microprocessor may be any conventional general purpose single- ormulti-chip microprocessor such as a Pentium® processor, a Pentium® Proprocessor, a 8051 processor, a MIPS® processor, a Power PC® processor,or an Alpha® processor. In addition, the microprocessor may be anyconventional special purpose microprocessor such as a digital signalprocessor or a graphics processor. The microprocessor typically hasconventional address lines, conventional data lines, and one or moreconventional control lines.

The system may be used in connection with various operating systems suchas Linux®, UNIX® or Microsoft Windows®.

The system control may be written in any conventional programminglanguage such as C, C++, BASIC, Pascal, .NET (e.g., C#), or Java, andran under a conventional operating system. C, C++, BASIC, Pascal, Java,and FORTRAN are industry standard programming languages for which manycommercial compilers may be used to create executable code. The systemcontrol may also be written using interpreted languages such as Perl,Python or Ruby. Other languages may also be used such as PHP,JavaScript, and the like.

The foregoing description details certain embodiments of the systems,devices, and methods disclosed herein. It will be appreciated, however,that no matter how detailed the foregoing appears in text, the systems,devices, and methods may be practiced in many ways. As is also statedabove, it should be noted that the use of particular terminology whendescribing certain features or aspects of the invention should not betaken to imply that the terminology is being re-defined herein to berestricted to including any specific characteristics of the features oraspects of the technology with which that terminology is associated.

It will be appreciated by those skilled in the art that variousmodifications and changes may be made without departing from the scopeof the described technology. Such modifications and changes are intendedto fall within the scope of the embodiments. It will also be appreciatedby those of skill in the art that parts included in one embodiment areinterchangeable with other embodiments; one or more parts from adepicted embodiment may be included with other depicted embodiments inany combination. For example, any of the various components describedherein and/or depicted in the Figures may be combined, interchanged orexcluded from other embodiments.

With respect to the use of substantially any plural and/or singularterms herein, those having skill in the art may translate from theplural to the singular and/or from the singular to the plural as isappropriate to the context and/or application. The varioussingular/plural permutations may be expressly set forth herein for sakeof clarity.

It will be understood by those within the art that, in general, termsused herein are generally intended as “open” terms (e.g., the term“including” should be interpreted as “including but not limited to,” theterm “having” should be interpreted as “having at least,” the term“includes” should be interpreted as “includes but is not limited to,”etc.). It will be further understood by those within the art that if aspecific number of an introduced claim recitation is intended, such anintent will be explicitly recited in the claim, and in the absence ofsuch recitation no such intent is present. For example, as an aid tounderstanding, the following appended claims may contain usage of theintroductory phrases “at least one” and “one or more” to introduce claimrecitations. However, the use of such phrases should not be construed toimply that the introduction of a claim recitation by the indefinitearticles “a” or “an” limits any particular claim containing suchintroduced claim recitation to embodiments containing only one suchrecitation, even when the same claim includes the introductory phrases“one or more” or “at least one” and indefinite articles such as “a” or“an” (e.g., “a” and/or “an” should typically be interpreted to mean “atleast one” or “one or more”); the same holds true for the use ofdefinite articles used to introduce claim recitations.

In addition, even if a specific number of an introduced claim recitationis explicitly recited, those skilled in the art will recognize that suchrecitation should typically be interpreted to mean at least the recitednumber (e.g., the bare recitation of “two recitations,” without othermodifiers, typically means at least two recitations, or two or morerecitations). Furthermore, in those instances where a conventionanalogous to “at least one of A, B, and C, etc.” is used, in generalsuch a construction is intended in the sense one having skill in the artwould understand the convention (e.g., “a system having at least one ofA, B, and C” would include but not be limited to systems that have Aalone, B alone, C alone, A and B together, A and C together, B and Ctogether, and/or A, B, and C together, etc.).

It will be further understood by those within the art that virtually anydisjunctive word and/or phrase presenting two or more alternative terms,whether in the description, claims, or drawings, should be understood tocontemplate the possibilities of including one of the terms, either ofthe terms, or both terms. For example, the phrase “A or B” will beunderstood to include the possibilities of “A” or “B” or “A and B.”

All references cited herein are incorporated herein by reference intheir entirety. To the extent publications and patents or patentapplications incorporated by reference contradict the disclosurecontained in the specification, the specification is intended tosupersede and/or take precedence over any such contradictory material.

The term “comprising” as used herein is synonymous with “including,”“containing,” or “characterized by,” and is inclusive or open-ended anddoes not exclude additional, unrecited elements or method steps.

All numbers expressing quantities used in the specification and claimsare to be understood as being modified in all instances by the term“about.” Accordingly, unless indicated to the contrary, the numericalparameters set forth in the specification and attached claims areapproximations that may vary depending upon the desired propertiessought to be obtained by the present invention. At the very least, andnot as an attempt to limit the application of the doctrine ofequivalents to the scope of the claims, each numerical parameter shouldbe construed in light of the number of significant digits and ordinaryrounding approaches.

The above description discloses several methods, devices and systems ofthe present invention. This invention is susceptible to modifications inthe methods, devices and systems. Such modifications will becomeapparent to those skilled in the art from a consideration of thisdisclosure or practice of the invention disclosed herein. Consequently,it is not intended that this invention be limited to the specificembodiments disclosed herein, but that it cover all modifications andalternatives coming within the true scope and spirit of the invention asembodied in the following claims.

What is claimed is:
 1. A method of tracking an object with an electronicdevice, the method comprising: defining a reference value based on anaverage light intensity of pixels in a region of an image framecomprising the object; determining an average light intensity of pixelsin the region of a current image frame comprising the object;calculating a difference between the reference value and the determinedaverage light intensity for the region in the current image frame;adjusting the intensity of pixels in the current image frame when thedifference is greater than an intensity limit; applying a gain filter tothe current image frame; and tracking the object using the pixels in thecurrent image frame.
 2. The method of claim 1, wherein adjustingcomprises subtracting the difference from every pixel of the currentimage frame.
 3. The method of claim 1, further comprising periodicallyredefining the reference value, as the average light intensity of pixelsin the region of the current image frame, when the difference is lessthan an intensity limit.
 4. The method of claim 1, wherein applying again filter comprises calculating a variation indicator of the regionbased on current and historical parameters of the region.
 5. The methodof claim 4, wherein applying a gain filter further comprises determininga confidence level based on the variation indicator.
 6. The method ofclaim 5, wherein applying a gain filter further comprises determining again based on the confidence level and determining the gain filter basedon the gain.
 7. The method of claim 6, wherein tracking the objectcomprises adjusting the region of the current image frame based on thegain filter.
 8. A system for tracking an object with an electronicdevice, the system comprising: a processor configured to: define areference value based on an average light intensity of pixels in aregion of an image frame comprising the object; determine an averagelight intensity of pixels in the region of a current image framecomprising the object; calculate a difference between the referencevalue and the determined average light intensity for the region in thecurrent image frame; adjust the intensity of pixels in the current imageframe when the difference is greater than an intensity limit; apply again filter to the current image frame; and track the object using thepixels in the current image frame.
 9. The system of claim 8, wherein theprocessor is configured to adjust the intensity of pixels by subtractingthe difference from every pixel of the current image frame.
 10. Thesystem of claim 8, wherein the processor is further configured toperiodically redefine the reference value, as the average lightintensity of pixels in the region of the current image frame, when thedifference is less than an intensity limit.
 11. The system of claim 8,wherein the processor is configured to apply a gain filter bycalculating a variation indicator of the region based on current andhistorical parameters of the region.
 12. The system of claim 11, whereinthe current and historical parameters comprise, respectively, currentand historical sizes of the region.
 13. The system of claim 11, whereinthe current and historical parameters comprise, respectively, currentand historical locations of the region.
 14. The system of claim 11,wherein the processor is configured to apply a gain filter bydetermining a confidence level based on the variation indicator.
 15. Thesystem of claim 14, wherein the processor is configured to apply a gainfilter by determining a gain based on the confidence level anddetermining the gain filter based on the gain.
 16. The system of claim15, wherein the processor is configured to track the object by adjustingthe region of the current image frame based on the gain filter.
 17. Thesystem of claim 16, wherein adjusting the region comprises adjusting thelocation of the region.
 18. The system of claim 16, wherein adjustingthe region comprises adjusting the size of the region.
 19. A system fortracking an object with an electronic device, the system comprising:means for defining a reference value based on an average light intensityof pixels in a region of an image frame comprising the object; means fordetermining an average light intensity of pixels in the region of acurrent image frame comprising the object; means for calculating adifference between the reference value and the determined average lightintensity for the region in the current image frame; means for adjustingthe intensity of pixels in the current image frame when the differenceis greater than an intensity limit; means for applying a gain filter tothe current image frame; and means for tracking the object using thepixels in the current image frame.
 20. The system of claim 19, whereinthe means for adjusting comprises a means for subtracting the differencefrom every pixel of the current image frame.
 21. The system of claim 19,wherein the system further comprises means for periodically redefiningthe reference value, as the average light intensity of pixels in theregion of the current image frame, when the difference is less than anintensity limit.
 22. The system of claim 19, wherein the means forapplying a gain filter comprises: means for calculating a variationindicator of the region based on current and historical parameters ofthe region; and means for determining a confidence level based on thevariation indicator.
 23. The system of claim 22, wherein the means forapplying a gain filter further comprises: means for determining a gainbased on the confidence level; and means for determining the gain filterbased on the gain.
 24. The system of claim 23, wherein the means fortracking the object comprises means for adjusting the region of thecurrent image frame based on the gain filter.
 25. A non-transitorycomputer readable medium configured to store instructions that whenexecuted by a processor perform a method for tracking an object with anelectronic device, the method comprising: defining a reference valuebased on an average light intensity of pixels in a region of an imageframe comprising the object; determining an average light intensity ofpixels in the region of a current image frame comprising the object;calculating a difference between the reference value and the determinedaverage light intensity for the region in the current image frame;adjusting the intensity of pixels in the current image frame when thedifference is greater than an intensity limit; applying a gain filter tothe current image frame; and tracking the object using the pixels in thecurrent image frame.
 26. The computer readable medium of claim 25,wherein adjusting comprises subtracting the difference from every pixelof the current image frame.
 27. The computer readable medium of claim25, wherein the method further comprises periodically redefining thereference value, as the average light intensity of pixels in the regionof the current image frame, when the difference is less than anintensity limit.
 28. The computer readable medium of claim 25, whereinapplying a gain filter comprises: calculating a variation indicator ofthe region based on current and historical parameters of the region; anddetermining a confidence level based on the variation indicator.
 29. Thecomputer readable medium of claim 28, wherein applying a gain filterfurther comprises: determining a gain based on the confidence level; anddetermining the gain filter based on the gain.
 30. The computer readablemedium of claim 29, wherein tracking the object comprises adjusting theregion of the current image frame based on the gain filter.